package com.example.test622.ui.video

import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.example.common.BR
import com.example.common.CommonAdapter
import com.example.common.R
import com.example.common.mvi.BaseView
import com.example.common.mvi.BaseViewModel
import com.example.net.entity.SimpleVideoEntity
import com.example.test622.databinding.ActivityVideoAactivityBinding

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken

@Route(path = "/v/va")
class VideoAActivity : BaseView<ActivityVideoAactivityBinding,BaseViewModel<*,*>>(){
	@JvmField
	@Autowired
	var d:String?=null
	val adapter by lazy {
		CommonAdapter<SimpleVideoEntity>({ com.example.test622.R.layout.simplevideoa to BR.videoa})
	}
	override fun initView() {
		binding.videoaRec.adapter = adapter
		ARouter.getInstance().inject(this)
		val gson = Gson()
		val listType = object : TypeToken<List<SimpleVideoEntity>>() {}.type
		val receivedVideoEntities: List<SimpleVideoEntity> = gson.fromJson(d, listType)
		adapter+=receivedVideoEntities
	}
	
	override fun initData() {
	
	}
}